package com.kt.uokos.yimo.service.impl;

import com.kt.uokos.yimo.dao.GrouponRules;
import com.kt.uokos.yimo.example.GrouponRulesExample;
import com.kt.uokos.yimo.mapper.GrouponRulesMapper;
import com.kt.uokos.yimo.service.GroupRulesService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class GroupRulesServiceImpl implements GroupRulesService {

    @Resource
    private GrouponRulesMapper grouponRulesMapper;

    @Override
    public List<GrouponRules> queryByPid(Integer id) {
        GrouponRulesExample example = new GrouponRulesExample();
        GrouponRulesExample.Criteria criteria = example.createCriteria();
        criteria.andGoodsIdEqualTo(id).andStatusEqualTo((short)0).andDeletedEqualTo(false);
        return grouponRulesMapper.selectByExample(example);
    }
}
